package com.jiangruan.javaproject.service;/**
 * @author:xulonghua
 * @email:3162193565@qq.com
 * desc:获取指定哈希的区块
 * datatime 2021/12/13 19:49
 */

import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javaproject.Constants;
import com.jiangruan.javaproject.bean.Getblock;

/**
 *@author:xulonghua
 *@email:3162193565@qq.com
 *desc:该方法用于rpc与bitcoin客户端的gitblock功能调用
 *datetime 2021/12/13 19:49
 */
public class GetBlock {
    public Getblock getblock(String blockhash){
        String result= UtilCommon.utilcommon ( 1001, Constants.Getblock, blockhash,0 );
        //把result数据解析成gitBlock类型
        Getblock getBlock = JSONObject.parseObject ( result, Getblock.class );
        return getBlock;
    }
}
